package cate.common.table.res.hero.back.sheet;

import cate.common.table.ESheet;
import cate.common.table.res.hero.back.row.HeroBackGradeRow;
import easy.java.dev.note.NoteClass;

import java.util.ArrayList;
import java.util.List;

@NoteClass(value = "英雄回退阶数奖励")
public class HeroBackGradeSheet extends ESheet<HeroBackGradeRow> {

    @Override
    public String getSheetName() {
        return "英雄回退阶数奖励";
    }

    @Override
    protected HeroBackGradeRow buildRow() {
        return new HeroBackGradeRow();
    }

    public List<HeroBackGradeRow> getRows(int currentGrade, int backGrade) {
        List<HeroBackGradeRow> rows = new ArrayList<>();
        for (HeroBackGradeRow  row : getList()) {
            if (currentGrade >= row.id && backGrade < row.id) {
                rows.add(row);
            }
        }
        return rows;
    }
}
